﻿using System;
using System.Runtime.Serialization;
using RayDen.Library.Core.Primitives;

namespace RayDen.Library.Entity.Frames
{
    [Serializable]
    [DataContract]
    [KnownType(typeof(FrameMaterialInfo))]
    public class FrameMaterialInfo : FrameElement
    {
        [DataMember]
        public string MaterialName { get; set; }

        [DataMember]
        public string BrdfClass { get; set; }

        [DataMember]
        public RgbSpectrum Diffuse { get; set; }

        [DataMember]
        public RgbSpectrum Glossy { get; set; }

        [DataMember]
        public RgbSpectrum Specular { get; set; }

        [DataMember]
        public RgbSpectrum Alpha { get; set; }

        [DataMember]
        public string AlphaTexture { get; set; }

        [DataMember]
        public string DiffuseTexture { get; set; }

        [DataMember]
        public string BumpTexture { get; set; }

        [DataMember]
        public string DataFile { get; set; }

        [DataMember]
        public float Exponent { get; set; }
    }


    [Serializable]
    [DataContract]
    public enum TextureDataType
    {
        ConstantColor,
        Image,
        Procedural
    }


    [Serializable]
    [DataContract]
    [KnownType(typeof(FrameMaterialTexture))]
    public class FrameMaterialTexture : FrameElement
    {
        [DataMember]
        public TextureDataType TextureDataType { get; set; }

        [DataMember]
        public string FileName { get; set; }

        [DataMember]
        public RgbSpectrum ConstValue { get; set; }

        [DataMember]
        public string SolidExpression { get; set; }
    }
}